<%--
  Created by IntelliJ IDEA.
  User: Kohler
  Date: 2022/11/10
  Time: 9:07
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>座位查询</title>
  <link rel="stylesheet" type="text/css" href="${path}css/common.css"/>
  <link rel="stylesheet" type="text/css" href="${path}css/main.css"/>
</head>
<body>
<%
  String path = request.getContextPath();
  String basePath = request.getScheme() + "://" +request.getServerName() + ":" + request.getServerPort() + path + "/";
  request.setAttribute("path",basePath);
%>
<%@include file="./adminSidebar.jsp"%>
<div class="main-wrap">

  <div class="crumb-wrap">
    <div class="crumb-list"><i class="icon-font"></i><a href="adminManage.jsp">首页</a><span class="crumb-step"></span><span class="crumb-name">查看座位情况</span></div>
  </div>
  <div class="search-wrap">
    <div class="search-content">
      <form action="http://localhost:8080/Library/admin/seatSelectAll" method="get">
        <table class="search-tab">
          <tr>
            <th width="120">楼层</th>
            <td>
              <select name="floor" >
                <option value="2">二楼</option>
                <option value="3">三楼</option><option value="4">四楼</option><option value="5">五楼</option>
              </select>
            </td>
            <th width="120">区域</th>
            <td>
              <select name="square" >
                <option value="北区域">北区域</option>
                <option value="东区域">东区域</option><option value="南区域">南区域</option>
              </select>
            </td>
            <th width="120">状态</th>
            <td>
              <select name="tstate" >
                <option value="未预约">未预约</option>
                <option value="已预约">已预约</option><option value="暂离">暂离</option>
              </select>
            </td>
            <td><input class="btn btn-primary btn2"  value="查询" type="submit"></td>

          </tr>
        </table>
      </form>
    </div>
  </div>
  <div class="result-wrap">
    <form name="myform" id="myform" method="post">
      <div class="result-title">
        <div class="result-list">
          <a href="adminSeatAdd.jsp"><i class="icon-font"></i>添加座位</a>
<%--          <a id="batchDel" href="javascript:void(0)"><i class="icon-font"></i>批量删除</a>--%>
<%--          <a id="updateOrd" href="javascript:void(0)"><i class="icon-font"></i>查看学生</a>--%>
        </div>
      </div>
      <div class="result-content">
        <table class="result-tab" width="100%">
          <tr>
            <th class="tc" width="5%"><input class="allChoose" name="" onclick="selall(this)" type="checkbox"></th>

            <th>编号</th>
            <th>楼层</th>
            <th>区域</th>
            <th>状态</th>
            <th>备注</th>
            <th>操作</th>
          </tr>
          <c:forEach var="s"  items="${seatlist}">
          <tr>
            <td class="tc"><input name="id[]" value="{s.tno}" type="checkbox"></td>
            <td>${s.tno}</td>
            <td>${s.tfloor}</td>
            <td>${s.tsquare}</td>
            <td>${s.tstate}</td>
            <td>${s.tinfo}</td>
            <td>
                <a class="link-update" href="http://localhost:8080/Library/admin/seatUpdate?tno=${s.tno}">修改</a>
              <a class="link-del" href="javascript:Delete('你确定删除【${s.tno}座位】吗?','http://localhost:8080/Library/admin/doUserDel?tno=${s.tno}&cpage=${cpage}')">删除</a>
            </td>
          </c:forEach>
          <script>
            function Delete(mess,url){
              if(confirm(mess)){
                location.href=url;
              }
            }
            function selall(o){
              var a = document.getElementsByName('id[]');
              for(var i=0;i<a.length;i++){
                a[i].checked = o.checked;
              }
            }
          </script>
        </table>
        <div class="list-page">
          共${tsum}条记录，当前${cpage}/${tpage}页
          <a href="http://localhost:8080/Library/admin/seatSelectAll?cp=1${searchParams}">首页</a>
          <a href="http://localhost:8080/Library/admin/seatSelectAll?cp=${cpage-1 < 0? 1:cpage-1}${searchParams}">上一页</a>
          <a href="http://localhost:8080/Library/admin/seatSelectAll?cp=${cpage+1>tpage?tpage:cpage+1}${searchParams}">下一页</a>
          <a href="http://localhost:8080/Library/admin/seatSelectAll?cp=${tpage}${searchParams}">尾页</a>
        </div>
      </div>
    </form>
  </div>
</div>
<!--/main-->
</div>

</body>
</html>
